﻿using System;
using System.Web;

namespace MvcWechat.App_Code
{
    public class CustomServerHeaderModule : IHttpModule
    {
        public void Init(HttpApplication context)
        {
            context.PreSendRequestHeaders += OnPreSendRequestHeaders;
        }

        public void Dispose()
        { }

        void OnPreSendRequestHeaders(object sender, EventArgs e)
        {
            // modify the “Server” Http Header
            //HttpContext.Current.Response.Headers.Remove("Server");  
            //Web应用安全之Response Header里的敏感信息 http://blog.csdn.net/ma_jiang/article/details/41013119
            HttpContext.Current.Response.Headers.Set("Server", "LS's Webserver");
        }
    }

}